home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / desktop / papcw10.zip / CALENDAR.WCM next >
Text File  |  1995-02-11  |  799b  |  32 lines

  1. // use Wincmd to invoke Calendar using the date that has
  2. // been put in the clipboard.
  3.  
  4. handle = checkrunning ("Calendar")
  5. if (handle)
  6.    appactivate (GetWindowText (handle))
  7. else
  8.     do
  9.         calendar.exe
  10.         delay (500)
  11.         handle = CheckRunning ("Calendar")
  12.         if (handle == 0)
  13.             exit
  14.         MoveWindow (handle, 10, 10)
  15.         sendkeys ("%vm")
  16.     end
  17.  
  18. sendkeys ("%sd")           // Open date dialog
  19. sendkeys (GetClipText())   // Enter date
  20. sendkeys ("{enter}")       // |
  21. exit
  22.  
  23. checkrunning:
  24.     handle = GetWindow (hmain, 0)
  25.     while (handle <> 0) do
  26.         text = GetWindowText (handle)
  27.         if (substr (text, 0, length(arg(1))) == arg(1))
  28.             return handle
  29.         handle = GetWindow (handle, 2)
  30.         end
  31.     return 0
  32.